import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../../theme/custom_theme.dart';

class Rating extends StatelessWidget {
  final String heat;
  const Rating({Key? key, required this.heat}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        RatingBar.builder(
          ignoreGestures: true,
          itemSize: 12.sp,
          initialRating: double.parse(heat) / 2,
          direction: Axis.horizontal,
          allowHalfRating: true,
          itemCount: 5,
          itemPadding: const EdgeInsets.symmetric(horizontal: 0),
          itemBuilder: (context, _) => const Icon(
            Icons.star,
            color: Colors.amber,
          ),
          onRatingUpdate: (double value) {},
        ),
        SizedBox(
          width: 5.w,
        ),
        Text(
          heat,
          style: TextStyle(
            fontSize: 10.sp,
            color: CustomTheme.colorSchema.neutral,
          ),
        )
      ],
    );
  }
}
